package cn.itsource.pethome.department.controller;

import cn.itsource.pethome.department.domain.Employee;
import cn.itsource.pethome.department.service.IEmployeeService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/emp")//设置了一个根路径
@Api(value = "员工的API",description="员工相关的CRUD功能")
public class EmployeeController {
    @Autowired
    private IEmployeeService employeeService;

    @GetMapping("/employee")
    public List<Employee> queryAll(){
        List<Employee> employees = employeeService.queryAll();
        return employees;
    }
}